package com.ex03_08;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class EX03_08Activity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button b1 = (Button)findViewById(R.id.button1);
        b1.setOnClickListener(new Button.OnClickListener(){
        	public void onClick(View v) {
				jumpToLayout2();
			}
        });
    }
    
    public void jumpToLayout2() {
		setContentView(R.layout.mylayout);
		Button b2 = (Button)findViewById(R.id.button2);
		b2.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				jumpToLayout1();
			}
		});
	}
    
    public void jumpToLayout1() {
		setContentView(R.layout.main);
		Button b1 = (Button)findViewById(R.id.button1);
		b1.setOnClickListener(new Button.OnClickListener(){
			public void onClick(View v){
				jumpToLayout2();
			}
		});
	}
    
    
}